package com.karolak.observer;

import org.bushe.swing.event.annotation.AnnotationProcessor;
import org.bushe.swing.event.annotation.EventSubscriber;

import com.karolak.event.MailMessage;

public class MailReader {

	String id;

	public MailReader(String id) {
		this.id = id;
		AnnotationProcessor.process(this);
	}

	@EventSubscriber()
	public void readMail(MailMessage msg) {
		System.out.println(String.format("MailReader{id:%s}, received:%s.", getId(), msg.toString()));
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
}
